use std::alloc;
use std::alloc::{alloc, Layout};
use manifold_sys::bindings::*;
use manifold_sys::ManifoldRust;

fn main() {
    unsafe{
        let sz = manifold_manifold_size();
        dbg!(sz);

        let layout = Layout::new::<ManifoldRust>();
        let sphere = manifold_sphere(alloc(layout) as _, 30.0, 100);
        let trans = manifold_translate(alloc(layout) as _, sphere,15., 0., 0.);
        let diff = manifold_difference(alloc(layout) as _, trans, sphere);

        let layout = Layout::new::<ManifoldRust>();

        dbg!(manifold_num_tri(sphere));
        dbg!(manifold_num_tri(diff));
        //
        // dbg!(manifold_get_properties(sphere));
        // dbg!(manifold_get_properties(diff));

        // ManifoldManifold *sphere = manifold_sphere(malloc(sz), 1.0f, 100);
        // ManifoldManifold *trans = manifold_translate(malloc(sz), sphere, 15., 0., 0.);
        // ManifoldManifold *warped = manifold_warp(malloc(sz), sphere, warp);
        // ManifoldManifold *diff = manifold_difference(malloc(sz), trans, warped);


    }

}
